package org.jfonia.connect5.gui;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Shape;
import java.util.LinkedHashSet;
import java.util.Set;
import javax.swing.JPanel;

/**
 * @author wijnand.schepens@hogent.be
 */
public class ComponentPanel extends JPanel
{
	private Set<IComponent> components = new LinkedHashSet<IComponent>();

	public void addComponent(IComponent comp)
	{
		components.add(comp);
	}

//	@Override
//	public void paint(Graphics g)
//	{
//
//	}

	@Override
	public void paintComponent(Graphics g)
	{
		super.paintComponent(g);
		
		Graphics2D g2 = (Graphics2D)g;

		for (IComponent comp: components)
			comp.paint(g2);
	}
}
